package com.hex.ds.hdrs.cron.vo;

import lombok.Data;
import lombok.experimental.Accessors;

import java.io.Serializable;
import java.util.List;

/**
 * @Package: com.hex.ds.hdrs.cron.vo
 * @ClassName CronTaskDefVo
 * @Description: 定时任务定义VO对象
 * @Author: wz.li
 * @Date 2023/4/3 14:19
 * @Version v2.0.2
 **/
@Data
@Accessors(chain = true)
public class CronTaskDefVo implements Serializable {

    private String pkId;

    private String taskCode;

    private String taskName;

    private String taskDesc;

    private String taskStatus;

    private String cronExpress;

    private String appCode;

    private Integer resNum;

    private String appointAgentCode;

    private String taskStDate;

    private String taskEndDate;

    private String[] startEndDate;

    private String isValidDate;

    private String shellPath;

    private String extParam;

    private String planExecDuration;

    private String overPlanDuration;

    public String getTaskStDate() {
        if ("1".equals(isValidDate) && startEndDate.length == 2){
            return startEndDate[1];
        }
        return taskStDate;
    }

    public String getTaskEndDate() {
        if ("1".equals(isValidDate) && startEndDate.length == 2){
            return startEndDate[2];
        }
        return taskEndDate;
    }
}
